Document Processing
Previous  Top  Next



Various commands and functions to process the text in a document.


Commands:

^!AddHeading
"HeadingName"
Adds a new heading to the active Outline document.

^!DeleteLine
Deletes the current line.

^!InsertFile FileName
Inserts the content of the specified file "FileName" at the cursor position.

^!SetColumnWrap nn
Defines the column position for word wrap. nn is the value in number of characters.

^!SetWordWrap ON/OFF (added in v4.51)
Changes word wrap mode in active document.

^!UpdateColumnWrap
NTS only. Reformats the text to fit within the defined column wrap. This command has no effect in NoteTab Pro.


Functions:

^$GetLine$
or
^$GetLine(Index)$

or
^$GetLine(+/-Index)$

Returns the text contained in the specified line. The "Index" parameter is optional. When it is not used, this function refers to the line where the cursor is placed; otherwise it refers to the line position from the start of the document. By preceding the number with a + or - sign, the Index value refers to the relative line position with respect to the current line (e.g. ^$GetLine(-1)$
refers to the previous line).

^$GetLineCount$
Returns total number of lines in the current document. This count is affected by the word-wrap status. The last line is considered to follow the last new line ("Enter") character, even if this line contains no characters. Or think of it as the total number of rows in the editor window.

^$GetLineSize$
or
^$GetLineSize(Index)$

or
^$GetLineSize(+/-Index)$

Returns the size of the text contained in the specified line. The "Index" parameter is optional. When it is not used, this function refers to the line where the cursor is placed; otherwise it refers to the line position from the start of the document. By preceding the number with a + or - sign, the Index value refers to the relative position with respect to the current line (e.g. ^$GetLineSize(+1)$ refers to the size of the next line).

^$GetParaCount$
Returns total number of paragraphs in the current document. In this context, a paragraph is defined as a sequence of characters terminated by a new line character. (New line characters are what is inserted when you press the "Enter" key in a document.) NoteTab's "paragraphs" are what many other programs call "lines". The GetParaCount command is not affected by the word-wrap status. When word-wrap is turned off, GetParaCount works the same as GetLineCount.

^$GetParagraph$ (added in v4.6)
or
^$GetParagraph(Index)$
(added in v4.6)
or
^$GetParagraph(+/-Index)$
(added in v4.6)
Returns the text contained in the specified paragraph (=single word-wrapped line). The "Index" parameter is optional. When it is not used, this function refers to the paragraph where the cursor is placed, otherwise it refers to the paragraph position from the start of the document. By preceding the number with a + or - sign, the Index value refers to the relative position with respect to the current paragraph (e.g. ^$GetParagraph(-1)$
refers to the previous paragraph).

^$GetText$
Returns the whole text contained in the active document.

^$GetTextSize$
Returns the text size of the current document.

^$GetTextLineCount$
Similar to ^$GetParaCount$
, but if the last character in the file is a new line it will not count the empty space after it as a line, the way that GetParaCount does. (A new line is what you get when you press "Enter" in a document. NoteTab's ^P token represents this.) That is, new line characters are considered by GetTextLineCount to merely terminate the current line. This gives a result that agrees with many other utilities, especially those used on UNIX systems.